
package de.swta.freezay.base;

import de.swta.freezay.FreezaySession;
import de.swta.freezay.Home;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.Model;

/**
 * LogoutPanel: displayed if the admin is logged in
 *
 * @author Jan Korreck
 * @author Christian Baeumer
 */
public final class LogoutPanel extends Panel {

    public LogoutPanel(String id) {
        
        super (id);

        /* add the logout link-button */
        add(new Form("loginForm", new Model("")) {

            @Override
            protected void onSubmit() {
                ((FreezaySession) getSession()).logout();
                setResponsePage(Home.class);
            }

         });
    }
}
